package com.atguigu.spzx.common.exception;


import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;


@Data
public class SPZXException extends RuntimeException {

    private Integer code;
    private String message;
    private String data;
    private ResultCodeEnum resultCodeEnum;

    public SPZXException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

    public SPZXException(ResultCodeEnum resultCodeEnum, String data) {
        this.data = data;
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

    public SPZXException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


}
